﻿<%@ Page Title="База номеров" Language="VB" MasterPageFile="~/adminnew/Layout.master" AutoEventWireup="false" CodeFile="Numbers.aspx.vb" Inherits="AdminNewNumbers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server">

    <a href="/adminnew/report.aspx/?type=phones" class="btn btn-success pull-right" style="margin-top: 20px;"><span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>&nbsp;Выгрузить в Excell</a>
    <h2 class="page-header" style="margin: 20px 0 10px 0;"><%=Master.Page.Title%></h2>

    <ul class="nav nav-tabs numbers">
        <li role="presentation" class="active"><a href="#">Водители</a></li>
        <li role="presentation"><a href="#">Клиенты</a></li>
    </ul>

    <div class="numbers" style="margin-top: 20px;">
        <div class="taxists">
            <table class="table table-bordered table-hover table-condensed table-striped" style="border: none; border-top: 1px solid #ddd;">
                <thead>
                    <tr>
                        <th width="45px;">№</th>
                        <th>ФИО</th>
                        <th>Телефон</th>
                        <th>Регистрация</th>
                        <th>Город</th>
                    </tr>
                </thead>
                <tbody>
                    <% Dim tindex = 1%>
                    <%For Each taxi In taxists%>
                    <tr>
                        <td><%=tindex%></td>
                        <td><a href="/adminnew/taxistinfo.aspx/?taxistid=<%=taxi.taxi_id%>&returlurl=<%=Request.Url.AbsoluteUri%>" title="Подробнее"><%=taxi.taxi_lastname + " " + taxi.taxt_firstname %></a></td>
                        <td>+<%=taxi.taxi_phone%></td>
                        <td><%=taxi.taxi_created.AddHours(3).ToString("d")%></td>
                        <td><%=taxi.cities.city_name%></td>
                    </tr>
                    <%tindex += 1
                    Next%>
                </tbody>
                <tfoot style="border: none;">
                    <tr style="border: none;">
                        <td colspan="6" style="border: none;">
                            <%-- @Html.Partial("_Paginator", PaginationHelper)--%>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>

        <div class="clients hide">
            <table class="table table-bordered table-hover table-condensed table-striped" style="border: none; border-top: 1px solid #ddd;">
                <thead>
                    <tr>
                        <th width="45px;">№</th>
                        <th>Телефон</th>
                        <th>Регистрация</th>
                        <th>Город</th>
                    </tr>
                </thead>
                <tbody>
                    <% Dim cindex = 1%>
                    <%For Each o In CType(Master.Page, adminnew_Numbers).orders%>
                    <tr>
                        <td><%=cindex%></td>
                        <td><%=o.order_user_phone%></td>
                        <td><%=CType(o.order_create, DateTime).AddHours(3).ToString("d")%></td>
                        <td><% Dim cityname As String = ""
                                If IsNothing(o.torders) <> True And o.torders.Count > 0 Then
                                    Dim torder = o.torders.FirstOrDefault()
                                    If IsNothing(torder) <> True Then
                                        cityname = torder.taxist.cities.city_name
                                    End If
                                End If
                                %>
                            <%=cityname%>
                        </td>
                    </tr>
                    <%cindex += 1
                    Next%>
                </tbody>
                <tfoot style="border: none;">
                    <tr style="border: none;">
                        <td colspan="6" style="border: none;">
                            <%-- @Html.Partial("_Paginator", PaginationHelper)--%>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <script type="text/javascript">
        $(document).ready(function () {
            setActivePage(1);

            $('ul.numbers li').click(function () {
                $('ul.numbers li').removeClass('active');
                $(this).addClass('active');
                var index = $(this).index();
                $('div.numbers > div').addClass('hide');
                $('div.numbers > div:eq(' + index + ')').removeClass('hide');
            });
        });
    </script>

</asp:Content>

